package com.hgw.Demo11_VisitorPattern.Exercises26_7_4;

/**
 * Data time:2021/12/21 21:19
 * StudentID:2019112118
 * Author:hgw
 * Description: 客户端测试类
 */
public class Client {
    public static void main(String[] args) {
        ShoppingCart cart = new ShoppingCart();
        Commodity apple,book1,book2;
        apple = new Apple("红富士", 7.84, 5);
        book1 = new Book("红楼梦", 50);
        book2 = new Book("水浒传", 33);

        cart.addCommodity(apple);
        cart.addCommodity(book1);
        cart.addCommodity(book2);

        People people;
        people = new Customer();
        cart.accept(people);
        System.out.println("------------------");
        people = new Cashier();
        cart.accept(people);
    }
}
